using System;

namespace JGSY.CMS.LowCode.Platform.Domain.Interfaces
{
    /// <summary>
    /// 审计实体接口
    /// 为实体提供创建和修改时间跟踪
    /// </summary>
    public interface IAuditableEntity
    {
        /// <summary>
        /// 创建时间
        /// </summary>
        DateTime CreatedAt { get; set; }

        /// <summary>
        /// 创建者ID
        /// </summary>
        long? CreatedBy { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        DateTime UpdatedAt { get; set; }

        /// <summary>
        /// 最后修改者ID
        /// </summary>
        long? UpdatedBy { get; set; }
    }

    /// <summary>
    /// 软删除实体接口
    /// 支持软删除功能
    /// </summary>
    public interface ISoftDeletableEntity
    {
        /// <summary>
        /// 是否已删除
        /// </summary>
        bool IsDeleted { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        DateTime? DeletedAt { get; set; }

        /// <summary>
        /// 删除者ID
        /// </summary>
        long? DeletedBy { get; set; }
    }

    /// <summary>
    /// 版本控制实体接口
    /// 支持乐观并发控制
    /// </summary>
    public interface IVersionableEntity
    {
        /// <summary>
        /// 版本号
        /// </summary>
        byte[] RowVersion { get; set; }
    }

    /// <summary>
    /// 多租户实体接口
    /// 支持多租户数据隔离
    /// </summary>
    public interface ITenantEntity
    {
        /// <summary>
        /// 租户ID
        /// </summary>
        string TenantId { get; set; }
    }

    /// <summary>
    /// 完整的基础实体接口
    /// 包含所有常用功能
    /// </summary>
    public interface IBaseEntity : IAuditableEntity, ISoftDeletableEntity, IVersionableEntity
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        long Id { get; set; }

        /// <summary>
        /// 状态 (1: 正常, 0: 禁用, -1: 删除)
        /// </summary>
        int Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        string? Remarks { get; set; }
    }
}
